(require (planet schematics/schemeunit:3))

(define (ex13 a b c)
  (cond ((and (<= a b) (<= a c))
         (+ (* b b) (* c c)))
        ((and (<= b a) (<= b c))
         (+ (* a a) (* c c)))
        (else
         (+ (* a a) (* b b)))))

(check-equal? (ex13 1 2 3) 13)
(check-equal? (ex13 1 3 2) 13)
(check-equal? (ex13 2 1 3) 13)
(check-equal? (ex13 2 3 1) 13)
(check-equal? (ex13 3 1 2) 13)
(check-equal? (ex13 3 2 1) 13)
(check-equal? (ex13 1 1 1) 2)
(check-equal? (ex13 5 1 1) 26)
(check-equal? (ex13 1 5 1) 26)
(check-equal? (ex13 1 1 5) 26)
